<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // 定义一组数组
        var arr = [80,45,67,75,98,30,34,90,96,33,100]
        var max_a = 0;  // 最大值
        var min_b = 100; // 最小值
        var min_c = 0; // 最小值下标
        var max_d = 0; // 最大值下标
        // 数组比较
        for (var i = 0; i < arr.length; i++) {
            // 跟最大值比较
            if (arr[i] > max_a) {
                max_a = arr[i];
                max_d = i;
            }
            // 跟最小值比较
            if (arr[i] < min_b) {
                min_b = arr[i];
                min_c = i;
            }
        }
        // 输出结果
		console.log("最大值" + max_a + "的下标是" + max_d);
		console.log("最小值" + min_b + "的下标是" + min_c);
    </script>
</head>
<body>
    
</body>
</html>